:root {
  --teal: #26b3a7;
  --teal-dark: #117d72;
  --ink: #142725;
  --muted: #657773;
  --line: #dbe7e3;
  --soft: #eef8f5;
  --white: #fff;
  --danger: #b72e2e;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: #f5f8f7;
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}
button, input { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.topbar {
  height: 88px;
  padding: 0 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.brand-logo { display: block; width: 208px; max-width: 100%; height: auto; }
.header-note { color: var(--muted); font-size: 12px; }

main { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 42px 0 30px; }
.intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.eyebrow { margin: 0 0 9px; color: var(--teal-dark); font-size: 11px; font-weight: 750; letter-spacing: 2px; }
h1 { margin: 0; font-size: clamp(34px, 5vw, 48px); font-weight: 650; letter-spacing: -1.5px; }
.intro-copy { margin-top: 10px; color: var(--muted); font-size: 15px; }
.badge { padding: 8px 13px; border: 1px solid #a8dcd4; border-radius: 30px; background: #e5f6f1; color: #176e64; font-size: 12px; }

.archive { overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 38px rgba(20, 39, 37, .05); }
.archive-heading { min-height: 96px; padding: 23px 28px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.archive-heading h2 { margin: 0; font-size: 22px; font-weight: 650; }
.archive-heading p { margin: 6px 0 0; color: var(--muted); }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--white); color: var(--teal-dark); }
.icon-button:hover { background: var(--soft); border-color: #afd9d1; }
.icon-button svg, .action-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.year-tabs { min-height: 62px; padding: 0 28px; display: flex; align-items: stretch; gap: 30px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.year-tab { min-width: 48px; padding: 0 5px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: #80908c; }
.year-tab:hover { color: var(--ink); }
.year-tab[aria-current="page"] { border-bottom-color: var(--teal); color: var(--ink); font-weight: 650; }
#status { min-height: 42px; margin: 0; padding: 14px 28px 8px; color: var(--muted); font-size: 12px; }
#status.error { color: #a12e28; }

.report-archive { padding: 0 28px 28px; }
.month-group { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); box-shadow: 0 4px 16px rgba(20, 39, 37, .035); }
.month-group summary { min-height: 70px; padding: 0 18px; display: grid; grid-template-columns: 1fr auto 24px; align-items: center; gap: 16px; list-style: none; }
.month-group summary::-webkit-details-marker { display: none; }
.month-group summary:hover { background: #fbfdfc; }
.month-name { font-size: 15px; font-weight: 650; }
.month-meta { color: var(--muted); font-size: 12px; }
.chevron { width: 22px; height: 22px; border: 1px solid #8ca09a; border-radius: 50%; position: relative; }
.chevron::before { content: ""; position: absolute; left: 6px; top: 6px; width: 7px; height: 7px; border-right: 1.5px solid #536963; border-bottom: 1.5px solid #536963; transform: rotate(45deg); transition: transform .18s, top .18s; }
.month-group[open] .chevron::before { top: 8px; transform: rotate(225deg); }
.day-list { border-top: 1px solid var(--line); background: #fbfdfc; }
.report-entry + .report-entry { border-top: 1px solid var(--line); }
.day-row { min-height: 78px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.day-date { min-width: 0; display: flex; align-items: center; gap: 15px; }
.day-date strong { width: 42px; height: 42px; display: grid; place-items: center; flex: none; border-radius: 50%; background: var(--soft); color: var(--teal-dark); font-size: 15px; }
.day-date span { font-size: 14px; font-weight: 550; }
.day-actions { display: flex; align-items: center; gap: 8px; }
.action-button { min-height: 40px; padding: 9px 13px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #cddbd7; border-radius: 7px; background: var(--white); color: #294a44; font-weight: 600; font-size: 12px; }
.action-button:hover { border-color: #7cbfb4; background: var(--soft); color: #106f65; }
.graph-button[aria-expanded="true"] { border-color: var(--teal); background: #e6f6f2; color: #0c756a; }

.inline-graph { padding: 24px; border-top: 1px solid var(--line); background: var(--white); }
.graph-heading { margin-bottom: 18px; display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.graph-heading h3 { margin: 0; font-size: 22px; font-weight: 650; text-transform: capitalize; }
.close-graph { padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); color: var(--muted); }
.close-graph:hover { color: var(--ink); background: var(--soft); }
.graph-loading, .graph-error, .empty { padding: 28px; color: var(--muted); text-align: center; }
.graph-error { color: #a12e28; }
.chart-card { padding: 20px; border: 1px solid var(--line); border-radius: 11px; background: var(--white); }
.chart-title { margin-bottom: 15px; }
.chart-title h4 { margin: 0 0 5px; font-size: 17px; }
.chart-title span { color: var(--muted); font-size: 12px; }
.combined-legend { margin-bottom: 14px; padding: 12px 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: #f4f8f6; }
.combined-legend-item { min-width: 0; display: flex; align-items: flex-start; gap: 9px; }
.swatch { width: 10px; height: 10px; margin-top: 4px; flex: none; border-radius: 50%; }
.combined-legend-item strong, .combined-legend-item small { display: block; }
.combined-legend-item strong { font-size: 13px; }
.combined-legend-item small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.chart-plot { position: relative; }
.chart-card svg { width: 100%; min-height: 220px; height: auto; display: block; }
.chart-card svg text { fill: var(--muted); font-family: "Segoe UI", Arial, sans-serif; font-size: 16px; }
.chart-tooltip { position: absolute; z-index: 2; width: min(500px, calc(100% - 16px)); max-height: calc(100% - 16px); overflow: hidden; padding: 14px 16px; border-left: 4px solid #4ec9ad; border-radius: 10px; background: #142e29; color: var(--white); box-shadow: 0 6px 24px rgba(20, 39, 37, .25); pointer-events: none; }
.chart-tooltip.invalid { border-left-color: #ff7777; }
.tooltip-hour { display: block; color: #c6ddd5; font-size: 15px; font-weight: 600; }
.combined-tooltip-grid { margin-top: 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 16px; }
.combined-tooltip-row { min-width: 0; display: flex; align-items: flex-start; gap: 8px; }
.combined-tooltip-row > span:last-child { min-width: 0; }
.combined-tooltip-row strong, .combined-tooltip-row span, .combined-tooltip-row small { display: block; }
.combined-tooltip-row strong { overflow: hidden; color: var(--white); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.combined-tooltip-row span { color: #e6f1ed; font-size: 13px; }
.combined-tooltip-row small { color: #adc8bf; font-size: 10px; }
.combined-tooltip-row .tooltip-limit { color: #ffb9b9; font-weight: 650; }
.chart-note { margin: 12px 2px 0; color: var(--muted); font-size: 11px; }

footer { margin-top: 22px; color: var(--muted); font-size: 10px; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #167d72; outline-offset: 3px; }

@media (max-width: 700px) {
  .topbar { height: 72px; padding: 0 20px; }
  .brand-logo { width: 180px; }
  .header-note { display: none; }
  main { width: min(100% - 28px, 1180px); padding-top: 26px; }
  h1 { font-size: 34px; }
  .intro-copy { font-size: 13px; }
  .archive-heading { min-height: 82px; padding: 18px; }
  .archive-heading h2 { font-size: 19px; }
  .archive-heading p { font-size: 12px; }
  .year-tabs { padding: 0 18px; gap: 20px; }
  #status { padding-left: 18px; padding-right: 18px; }
  .report-archive { padding: 0 12px 18px; }
  .month-group summary { padding: 0 14px; grid-template-columns: 1fr auto 22px; }
  .day-row { align-items: flex-start; flex-direction: column; padding: 14px; }
  .day-actions { width: 100%; }
  .action-button { flex: 1; }
  .inline-graph { padding: 16px 10px; }
  .graph-heading { padding: 0 5px; }
  .graph-heading h3 { font-size: 18px; }
  .chart-card { padding: 10px; }
  .combined-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; }
  .combined-tooltip-grid { grid-template-columns: 1fr; }
  .chart-tooltip { max-height: 94%; overflow: auto; }
}

@media print {
  .topbar, .intro, .archive-heading, .year-tabs, #status, footer, .day-row, .graph-heading, .chart-note { display: none !important; }
  body, main, .archive, .day-list, .inline-graph { background: white; }
  main { width: 100%; padding: 0; }
  .archive, .month-group, .chart-card { border: 0; box-shadow: none; }
  .month-group:not([open]), .report-entry:not(:has(.inline-graph:not([hidden]))) { display: none; }
}
